home *** CD-ROM | disk | FTP | other *** search
- Path: casbah.acns.nwu.edu!muzaffar
- From: muzaffar@casbah.acns.nwu.edu (Usman Muzaffar)
- Newsgroups: comp.lang.c
- Subject: Re: How can I use huge || very small number?
- Date: 1 Apr 1996 12:43:56 GMT
- Organization: Northwestern University, Evanston IL
- Message-ID: <4joj2c$jh2@news.acns.nwu.edu>
- References: <315681F3.314D@blue.nowcom.co.kr> <4joh0l$jch@news.acns.nwu.edu> <4joijj$m0h@news.fsu.edu>
- NNTP-Posting-Host: casbah.acns.nwu.edu
-
- In article <4joijj$m0h@news.fsu.edu>,
- Justin C Lloyd <lloyd@upsilon.cs.fsu.edu> wrote:
- >On 1 Apr 1996 12:08:53 GMT, Usman Muzaffar (muzaffar@casbah.acns.nwu.edu)
- >wrote:
- >** In article <315681F3.314D@blue.nowcom.co.kr>,
- >** whoever <whatever@blue.nowcom.co.kr> wrote:
- >** >may be it is FAQ but...
- >** >how can I compute 10000! or 0.12345......
- >
- >** 10000! is a very, very big number.
- >** I'm not sure it's even representable by standard IEEE fp notation.
- >** Any have that formula? 2*pi*e something or another.
- >
- >
- >I'm sorry that I don't remember the location (possibly sunsite.unc.edu?),
- >but there was a collection of C snippets/programs that contained a program
- >that "calculated" huge factorials by using strings. I don't recall the
- >algorithm, it was quite complicated. Anyone else know what I'm referring
- >to?
- >
-
- If it's what I'm thinking of, it's not complicated at all.
- Essentially, you teach the computer to do math the way we do, never doing
- more than one digit at a time, and just writing lines and lines of numerals
- in neat rows. The advantage is in output: it's not that you couldn't write
- a bit of code that couldn't calculate 10000!, but getting it from binary
- to decimal output is as cumbersome as calculating the value itself.
-
- Of course, the down side is that it's very slow, inelegant, and (let's face it)
- kind of stupid to get a computer to add the way we do. After all, it's the
- very fact that they *don't* do things slowly is what first attracted us. :)
-
- -usman
-
-
-